<%-- 
    Document   : product.jsp
    Created on : 14 mai 2012, 13:54:51
    Author     : Attia & Vincent
--%>

<%@page import="ecom.entity.ProductRemote"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <script type="text/javascript" src="JavaScript/eventJs.js"></script>
        <link rel=stylesheet type="text/css" href="CSS/style.css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Zombie Land</title>
    </head>
    <body>
        <jsp:include page="header.jsp" />
        <div id="product">
            <form name="form" action="TestServlet?action=addCart" method="POST">
                <table id="allProduct">
                    <tr>
                        <th scope="col">ICON</th>
                        <th scope="col">NAME</th>
                        <th scope="col">REFERENCE</th>
                        <th nowrap scope="col">DESCRIPTION</th>
                        <th nowrap scope="col">PRICE</th>
                        <th nowrap scope="col">QUANTITY</th>
                    </tr>	
                    <%
                        List<ProductRemote> pList = (List<ProductRemote>) request.getAttribute("plist");
                        int i = 0;
                        for (ProductRemote p : pList) {
                    %>
                    <tr>
                        <% i = i + 1;%>
                        <td><img src="<%= p.getUrlImage()%>" alt="N/A" width="50px" height="50px" /></td>
                        <td><%= p.getName()%></td>
                        <td><%= p.getReference()%></td>
                        <td></td>
                        <td><%= p.getPrice()%> &euro;</td>
                        <td nowrap><input type="text" size="3" id="<%= p.getReference()%>" name="quantity<%=i%>" onchange="addRequestProduct(<%= p.getReference()%>,<%=i%>)"></td>

                        <% }%>
                        <td colspan="2">  <input id="submit" name="submit" type="submit" value="Valider" /></td>
                </table>
                <input type="text" id="allQuantity" name="allQuantity" style="display:none;">
                <input type="text" id="allRef" name="allRef" style="display:none;">
            </form>
        </div>
        <jsp:include page="footer.jsp" />
    </body>
</html>
